#ifndef ZPP_ASSERT_HPP
#define ZPP_ASSERT_HPP
#include <zephyr/sys/__assert.h>
#include <zpp/error_code.hpp>
#define ZPP_ASSERT_EQUAL(expr, value)                                          \
  __ASSERT_EVAL(                                                               \
      expr, const auto zpp_assert_ret = (expr), zpp_assert_ret == value,       \
      "expected value: %d, actual value = %d", value, zpp_assert_ret)
#define ZPP_ASSERT_NEQ(expr, value)                                            \
  __ASSERT_EVAL(expr, const auto ret = (expr), ret != value,                   \
                "expected: %d != %d", ret, value)
#define ZPP_ASSERT_TRUE(val) ZPP_ASSERT_EQUAL((val), true)
#define ZPP_ASSERT_FALSE(val) __ASSERT_NO_MSG((val) == false)
#define ZPP_ASSERT_EQ(expr, value) ZPP_ASSERT_EQUAL(expr, value)

#define ZPP_ASSERT_OK(expr)                                                    \
  __ASSERT_EVAL(expr, const auto zpp_assert_ret = (expr), zpp_assert_ret == 0, \
                "error code %s",                                               \
                zpp::error_str(zpp::error_code(-zpp_assert_ret)))
#define ZPP_ASSERT_LST(expr, value)                                            \
  __ASSERT_EVAL(expr, const auto ret = (expr), ret < value,                    \
                "expected value: %d", value)

#define ZPP_ASSERT_LSE(expr, value)                                            \
  __ASSERT_EVAL(expr, const auto ret = (expr), ret <= value,                   \
                "expected value: %d", value)

#define ZPP_ASSERT_LGT(expr, value)                                            \
  __ASSERT_EVAL(expr, const auto ret = (expr), ret > value,                    \
                "expected value: %d", value)

#define ZPP_ASSERT_LGE(expr, value)                                            \
  __ASSERT_EVAL(expr, const auto ret = (expr), ret >= value,                   \
                "expected value: %d", value)
#endif
